package cn.kgc.sprignboot.redis.controller;

import cn.kgc.sprignboot.redis.entity.User;
import cn.kgc.sprignboot.redis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 课工场
 * @date 2024/12/3
 * @description
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;


    @GetMapping("list")
    public List<User> userList(){
        return userService.list();
    }


    @GetMapping("remove/{id}")
    public Boolean  removeUser(@PathVariable("id") Integer id){
        return userService.removeById(id);
    }



}
